import { Component } from '@angular/core';
import {NgbModal} from '@ng-bootstrap/ng-bootstrap';
import {LoginComponent} from './components/login/login.component';
import {Router} from '@angular/router';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'cms';
  islogin=false;
  //islogin=true;

  constructor( private modalService: NgbModal
  ,private router:Router){

  }

  openLoginForm(){
    const modalRef = this.modalService.open(LoginComponent);

    modalRef.result
      .then((data:any)=>{
        console.log(data);
        switch (data) {
          case 'regist':
            this.router.navigate(['/regist']);
            break
          case 'success':
            this.islogin=true;
            break
        }




      })

  }


}
